shadertoy demo: Fix GLSL on GLES
authorAlexander Larsson <alexl@redhat.com>
Wed, 23 Sep 2020 15:38:03 +0000 (17:38 +0200)
committerAlexander Larsson <alexl@redhat.com>
Tue, 29 Sep 2020 07:51:16 +0000 (09:51 +0200)
I was getting "assignment to varying fragColor" errors

demos/gtk-demo/gtkshadertoy.c

index 866bd69481677a345e0cb500868f5f02651613b2..7d8c4926f6d22467c1c0c012e810c192d58ce77c 100644 (file)
@@ -56,13 +56,15 @@ const char *fragment_prefix =
   "uniform float     iSampleRate;           // sound sample rate (i.e., 44100)\n"
   "\n"
   "in vec2 fragCoord;\n"
-  "out vec4 fragColor;\n";
+  "out vec4 vFragColor;\n";
 
 
 // Fragment shader suffix
 const char *fragment_suffix =
   "    void main() {\n"
-  "        mainImage(fragColor, fragCoord);\n"
+  "        vec4 c;\n"
+  "        mainImage(c, fragCoord);\n"
+  "         vFragColor = c;\n"
   "    }\n";
 
 typedef struct {